<template>
	<view class="container">
		<!--头部start-->
		<view class="header">
			<u-status-bar></u-status-bar>
			<view class="con">
				<image src="/static/images/back.png" mode="widthFix" class="back"></image>
				<view class="tit">订单</view>
			</view>
		</view>
		<u-status-bar></u-status-bar>
		<!--头部end-->
		
		<!--订单start-->
		<view v-show="navIndex==0">
			<orderBuy :height="height"></orderBuy>
		</view>
		
		<view v-show="navIndex==1">
			<orderSell :height="height"></orderSell>
		</view>
		
		<view class="order_btn">
			<view>
				<button :class="navIndex==0?'active':''" @click="checkIndex(0)">购买</button>
				<button :class="navIndex==1?'active':''" @click="checkIndex(1)">出售</button>
			</view>
		</view>
		<!--订单end-->
		
	</view>
</template>

<script>
import orderBuy from './order_buy.vue'
import orderSell from './order_sell.vue'
export default {
	components:{
		orderBuy,orderSell
	},
    data() {
        return {
            height: '',
			navIndex: 0,
        }
    },
    onLoad(){
    	this.height = uni.getSystemInfoSync().windowHeight - uni.upx2px(300)  + 'px';
    },	
    methods: {
		checkIndex(index) {
			this.navIndex = index;
		},
    }
}
</script>

<style lang="scss">
@import url("../../common/style.scss");
@import url("create.scss");
</style>